package com.example.mytestdemo.customviewbook

import android.animation.ObjectAnimator
import android.util.Log
import android.view.WindowManager
import androidx.core.animation.addListener
import com.example.mytestdemo.BaseViewBindActivity
import com.example.mytestdemo.R
import com.example.mytestdemo.databinding.ActivityTestTranslateBinding
import com.example.mytestdemo.softkey.SoftKeyBoardListener.OnSoftKeyBoardChangeListener
import com.example.mytestdemo.utils.SoftKeyBoardListener


class TesttranslateActivity : BaseViewBindActivity<ActivityTestTranslateBinding>() {


    override fun getLayoutInflateId(): Int {
        return R.layout.activity_test_translate
    }

    override fun initData() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)
        mBind.translate.post {


            val animation = ObjectAnimator.ofFloat(mBind.translate, "translationY", mBind.translate.top.toFloat()+100, mBind.translate.top.toFloat()+300f)
            animation.duration = 3000
            animation.addListener(onEnd = {
                Log.d(TAG, "initData:jieshu ")



            })
            animation.startDelay = 5000
            animation.start()

            SoftKeyBoardListener.setListener(this,object :OnSoftKeyBoardChangeListener{
                override fun keyBoardShow(height: Int) {
                }

                override fun keyBoardHide(height: Int) {

                }

            })

        }

    }

    override fun initUI() {


    }


}